﻿<Window x:Class="Adan.Client.Dialogs.HighlightEditDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls1="clr-namespace:Adan.Client.Common.Controls;assembly=Adan.Client.Common" ResizeMode="NoResize" 
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" 
        WindowStyle="ToolWindow" 
        Width="485"
        Height="230"
        Title="Higlight editor"
        Style="{StaticResource DefaultWindowStyle}" xmlns:my="clr-namespace:Adan.Client.Common.Utils;assembly=Adan.Client.Common">
    <Window.Resources>
        <my:TextColorToBrushConverter x:Key="TextColorToBrushConverter" />
        <my:BackgroundTextColorToBrushConverter x:Key="BackgroundTextColorToBrushConverter" />
    </Window.Resources>
    <Grid Margin="3">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Label>Text to highlight:</Label>
            <TextBox Text="{Binding Path=TextToHighlight}" />
        </StackPanel>
        <Grid Grid.Row="1" Margin="0,5,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">Text color:</Label>
            <Controls1:ColorSelector Grid.Column="1"  Grid.Row="0" Margin="5,5,0,0"  SelectedColor="{Binding Path=TextColor, Mode=TwoWay}" Width="150" />
            <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center">Background color:</Label>
            <Controls1:BackgroundColorSelector Grid.Column="1" Grid.Row="1" Margin="5,5,0,0"  SelectedColor="{Binding Path=BackgroundColor, Mode=TwoWay}" Width="150"/>

            <TextBlock Grid.Column="2" Grid.Row="0" Grid.RowSpan="2" FontSize="22" Text="Sample text" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="15,0,15,0" FontFamily="../Resources/consola.ttf#Consolas" Foreground="{Binding Path=TextColor, Converter={StaticResource TextColorToBrushConverter}}" Background="{Binding Path=BackgroundColor, Converter={StaticResource BackgroundTextColorToBrushConverter}}" />
        </Grid>

        <StackPanel Grid.Row="2">
            <Label  Padding="5">Group name:</Label>
            <ComboBox Padding="5" Width="150" ItemsSource="{Binding Path=AllGroups}" DisplayMemberPath="Name" SelectedValue="{Binding Path=HighlightGroup}" HorizontalAlignment="Left" />
        </StackPanel>
        <CheckBox Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5,0,0,0" IsChecked="{Binding Path=IsRegExp}">
            IsRegExp
        </CheckBox>
        <StackPanel HorizontalAlignment="Right" Grid.Row="4" Orientation="Horizontal" Margin="0,5,0,0">
            <Button HorizontalAlignment="Right" IsDefault="True" MinWidth="50" Click="HandleOkClicked">Ok</Button>
            <Button HorizontalAlignment="Right" Margin="5,0,0,0" MinWidth="50" Click="HandleCancelClicked">Cancel</Button>
        </StackPanel>
    </Grid>
</Window>

